
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Grebok.Common;
using Grebok.Common.Configuration;

namespace EVegetable.Persistence.Test.DataManager
{
    public class TIni_ModulePropertyManager : BaseManager
    {
        #region private field

        private static TIni_ModulePropertyManager manager;
        #endregion

        #region Properties
        
        public Int32 ModuleID
        {
            get { return GetConfig<Int32>("ModuleID"); }
            set { SetConfig<Int32>("ModuleID", value); }
        }
        
        public String ModuelName
        {
            get { return GetConfig<String>("ModuelName"); }
            set { SetConfig<String>("ModuelName", value); }
        }
        
        public String ModuleCode
        {
            get { return GetConfig<String>("ModuleCode"); }
            set { SetConfig<String>("ModuleCode", value); }
        }
        
        public Int32? CodeModeID
        {
            get { return GetConfig<Int32?>("CodeModeID"); }
            set { SetConfig<Int32?>("CodeModeID", value); }
        }
        
        public Int32? SerialLength
        {
            get { return GetConfig<Int32?>("SerialLength"); }
            set { SetConfig<Int32?>("SerialLength", value); }
        }
        

        #endregion

        #region Constructor

        /// <summary>
        /// TIni_ModulePropertyManager
        /// </summary>
        private TIni_ModulePropertyManager()
        {
            IApplicationConfiguration configuration = ApplicationConfigurationFactor.CreateApplicationConfiguration();
            appPropertiese = new ApplicationProperties(configuration[PropertiesConst.TINI_MODULEPROPERTY_PROPERTIES_FILE_NAME_KEY],
                configuration[PropertiesConst.TINI_MODULEPROPERTY_PROPERTIES_SECTION_NAME_KEY]);

            appPropertieseValues = new Dictionary<string, object>();
        }
        #endregion

        #region TIni_ModulePropertyManager Instance

        /// <summary>
        /// TIni_ModulePropertyManager's Instance
        /// </summary>
        public static TIni_ModulePropertyManager Instance
        {
            get
            {
                if (manager == null)
                {
                    manager = new TIni_ModulePropertyManager();
                }
                return manager;
            }
        }
        #endregion

    }
}
